﻿using FastapiBlazorBlog;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

// 添加Ant Design Blazor服务
builder.Services.AddAntDesign();

builder.Services.AddScoped(sp =>
    new HttpClient
    {
        //BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) 
        //BaseAddress = new Uri("http://127.0.0.1:7788")
        BaseAddress = new Uri(Utils.BASE_URL)
    }
);

await builder.Build().RunAsync();
